﻿using DHQGHN.DAL.Common;
using DHQGHN.DAL.DAO.DHQG;
using DHQGHN.DAL.Models.DHQG;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DHQGHN.DAL.BO.DHQG
{
    public class NamKeHoachBO :BaseBO
    {
        private NamKeHoachDAO _dao;

        public const string NAM_KE_HOACH_ID = "NAM_KE_HOACH_ID";
        public const string NAM_KE_HOACH = "NAM_KE_HOACH";
        public const string STATUS_ID = "STATUS_ID";
        public const string STATUS_DATE = "STATUS_DATE";
        public NamKeHoachBO()
        {
            _dao = new NamKeHoachDAO(Common.ConnectionUtil.DHQGHN_CONNECTION_STRING, DEFAULT_MAPPER_TYPE);
        }


        public NamKeHoach GetById(int id)
        {
            try
            {
                return _dao.GetById(id);
            }
            catch
            {
                throw;
            }
        }
        public int Check(int namkhid,int statusid)
        {
            try
            {
                return _dao.Check(namkhid, statusid);
            }
            catch
            {
                throw;
            }
        }
        public int NamkehoachUpdate(int namkhid, int statusid)
        {
            try
            {
                return _dao.NamkehoachUpdate(namkhid, statusid);
            }
            catch
            {
                throw;
            }
        }
        public NamKeHoach GetByNam(string namkh)
        {
            try
            {
                return _dao.GetByNam(namkh);
            }
            catch
            {
                throw;
            }
        }
        public List<NAMDV> CheckPhaiHoiChot(int namkhid, int statusid)
        {
            try
            {
                return _dao.CheckPhaiHoiChot(namkhid, statusid);
            }
            catch
            {
                throw;
            }
        }
        public int CheckChot(int namkhid, int statusid, int nhomdonvi)
        {
            try
            {
                return _dao.CheckChot(namkhid, statusid, nhomdonvi);
            }
            catch
            {
                throw;
            }
        }
        public int CheckNamChot(int namkhid, int statusid, int nhomdonvi)
        {
            try
            {
                return _dao.CheckNamChot(namkhid, statusid, nhomdonvi);
            }
            catch
            {
                throw;
            }
        }
        public int Save(NamKeHoach model)
        {
            try
            {
                return _dao.Save(model);
            }
            catch
            {
                throw;
            }
        }
        public List<Status> Getallstatus()
        {
            try
            {
                return _dao.Getallstatus();
            }
            catch
            {
                throw;
            }
        }
        public bool Delete(int id)
        {
            try
            {
                return _dao.Delete(id);
            }
            catch
            {
                throw;
            }
        }
        public List<NamKeHoach> GetAllNamkehoach()
        {
            try
            {
                return _dao.GetAllNamkehoach();
            }
            catch
            {
                throw;
            }
        }
    }
}
